#!/bin/bash
HOST=localhost
PORT=3306
USER=root
PASS='MTIzNDU2Cg=='
PASS=`cat $PASS | base64 -d`

mysql -h$HOST -P$PORT -u$USER -p$PASS <<EOF
tee ./mysql_execlog-`date +%F-%T`.txt
#写入需要执行的固定sql
use mysql;
select Host,User FROM user;
notee;
EOF